﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IconYuan.Model.Entity.Markets
{
    [SugarTable("t_coupon")]
    public class Coupon
    {
        /// <summary>
        /// 自增,优惠券id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public int coupon_id { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public int store_id { get; set; }
        /// <summary>
        /// 	优惠券名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 优惠券类型(10满减券 20折扣券)
        /// </summary>
        public int coupon_type { get; set; } = 10;
        /// <summary>
        /// 满多少金额
        /// </summary>
        public decimal min_price { get; set; }
        /// <summary>
        /// 满减券，减多少
        /// </summary>
        public decimal reduce_price { get; set; }
        /// <summary>
        /// 折扣券-折扣率(0-100)
        /// </summary>
        public int discount { get; set; }
        /// <summary>
        /// 到期类型(10领取后生效 20固定时间)
        /// </summary>
        public int expire_type { get; set; } = 10;
        /// <summary>
        /// 领取后多少天内有效
        /// </summary>
        public int expire_day { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime start_time { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime end_time { get; set; }
        /// <summary>
        /// 适用范围(10全部商品 20指定商品 30排除商品)
        /// </summary>
        public int range { get; set; }
        /// <summary>
        /// 适用范围配置(json格式）
        /// </summary>
        public string range_config { get; set; }
        /// <summary>
        /// 发放总数量
        /// </summary>
        public int total_num { get; set; }
        /// <summary>
        /// 已领取数量
        /// </summary>
        public int receive_num { get; set; }
        /// <summary>
        /// 优惠券描述
        /// </summary>
        public string describe { get; set; }
        /// <summary>
        /// 状态(1显示 0隐藏)
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 排序方式(数字越小越靠前)
        /// </summary>
        public int sort { get; set; } = 100;
        /// <summary>
        /// 是否删除: 0 未删除, 1 已删除
        /// </summary>
        public int is_delete { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

    }
}
